package com.andf.demo.service.impl;

import java.util.List;

import org.springframework.stereotype.Service;

import com.andf.basic.AndfSqlMapClientDao;
import com.andf.demo.form.InsertForm;
import com.andf.demo.model.CommandMode;
import com.andf.demo.model.UserInfoMode;
import com.andf.demo.service.IDemoService;

@Service("demoService")
public class DemoService extends AndfSqlMapClientDao implements IDemoService {

	public List<UserInfoMode> qryUserInfoList(int userid) {
		UserInfoMode mode = new UserInfoMode();
		mode.setUserid(userid);
		mode.setTitle("学生");
		return getSqlSession().selectList("demo.getUserList", mode);
	}

	@Override
	public void insCommandMode(InsertForm form) {
		// 参数封装
		CommandMode mode = new CommandMode();
		mode.setCommandText(form.getText1());
		mode.setCommandType(form.getText2());

		// SQL执行
		int i = 1;//getSqlSession().insert("demo.insertCommand", mode);

		// 插入主键显示
		System.out.println(mode.getCommandID());

		// 映影记录数显示
		System.out.println(i);

	}

}
